Loan Computations

Kurt Bryan and SIMIODE

This is a notebook to illustrate loan payment computations for the "Money Matters" project in Chapter 2.

First, choose the interest rate "r", initial borrowed amount "p0", number of payments, and monthly payment "b":

r= 0.03
p0 = 250000
b = 1726.45
payments = 180

Loop over months, store balance in array "p", indexed from p[0] to p[payments].

p =ConstantArray[0,payments];
StringForm["Month `` Balance ``", 0,NumberForm[N[p0],{6,2}] ]
p[[1]] = (1+r/12)*p0-b;
s = StringForm["Month `` Interest `` Balance ``", 1,r*p0/12,NumberForm[N[p[[1]]],{6,2}] ]
For[k =2,k≤payments, k++,
p[[k]] = (1+r/12)*p[[k-1]]-b;
s = StringForm["Month `` Interest `` Balance ``", k,r*p[[k-1]]/12,NumberForm[N[p[[k]]],{6,2}] ];
Print[s]
]